			Hex Tutor(Plus binary)
----------------------------------------------------------------------------

	Hex, although it seems tough, is suprisingly VERY easy! I didn't
understand it at first, because, like many of you, I didn't totally 
understand decimal. Our system is base 10, which means:

123 means: a 3 is in the signal number place, which means whatever is here 
is "as-is", with no changes. Now, the 2 is in the 10 to the power of 1, 
which is 10, so you times 2 by 10 to get 20. The 1 is in the 10 to the 
second power place, which is 10 x 10 = 100, 1 x 100  because a one is 
there, which equals out to 100. Now add all these number, to get 123. 

	Maybe you should try to follow this method of teaching:
123 = 1 x 100 + 2 x 10 + 3 x 1 
	      -or-
123 = 1 x 10^2 + 2 x 10^1 + 3 x 10^0

	The ^'s mean "to the power of".

	I will explain it again. 
----------------------------------------------------------------------------

	Decimal is the base 10 numbering system, which means, every number 
to the left is another power of 10. Every number system must go by a base
number, decimal's is 10, hex is 16. Ignore hex for now. 

	The decimal number, 563, really is 5 times 10 to the second power +
6 times 10 to the first power + 3 times 10 to the 0 power which is 3 
times 1, which equals 563. Take this approach once again if you didn't get 
it very well in my paragraph:

563 is in decimal.
Each number to the left is another power of 10.
3 is in the 0 power of 10, 6 is in the 1st power of 10, and 5 is in the 
2nd power of 10. Watch this:

563 = 5 x 10^2 + 6 x 10^1 + 3 x 10^0 (or just 3) 
            -- -       -- -       --  ---------

	I underlined the parts you should pay special attention to. AGAIN:
Remember that the ^'s mean to the power of the number next to it. So:
10^6 = 10 to the power of 6
10^0 = 10 to the power of 0
10^7 = 10 to the power of 7

	Lets work through a bigger number. Lets try 3456:

There is a 3 in the 10^3 place, a 4 in the 10^2 place, a 5 in the 10^1, and
a 6 in the 10^0 spot, which can just be thought of as a spot of no ^'s.
	So, you get the sum of 10 x 10 x 10, which is 1000, and times it by
the number in that place, 3, and get 3000. You get the sum of 10 X 10, 
which is 100, and times it by the number in THAT place, which is 4, and get
400. Then get the sum of 10 x 1, which is 10, and times it by the number in 
that place, which is 5, and you get 50. Then leave 6 as 6. Add them up, 5000 
plus 400 plus 50 plus 6 as it is, and you get 3456.
	This is another approach to this problem:

3456 = 3 x (10 x 10 x 10) = 1000 + 4 x (10 x 10) = 100 + 5 x (10 x 1) = 10,+
6 (10 x 0) = no powers.
				   -or-
3456 = 3 x 1000 + 4 x 100 + 5 x 10 + 6 
				   -or-
3456 = 3 x 10 x 10 x 10 + 4 x 10 x 10 + 5 x 10 x 1 + 6 
----------------------------------------------------------------------------

	And, thus, you should already know, there is NO way to represent 
more then one number in any signal number system. Take a look at this:

10 = A = 00001010

	Huh!? That's right, you'll soon understand all of that. 10 is equal
to A in hex, which are both equal to 00001010 in binary. Binary is just a
added bonus I put in, you don't need to understand it here. BUT: If your
going to do any programming that requires use of the joystick or deep 
machine language like games, then you should take the little bit of time to
understand it. For now, get the hex part in.

	Do you understand decimal yet? Decimal is what you use to count, 
the only reason we use base 10 is because we have 10 fingers. The computer,
having "two fingers", which are on and off, uses a base 2 number system
called binary. Binary is EASY!! The reason it is so simple is because 
computers are so stupid. If the computer used our base 10 system for it's
native language, it would be a LOT slower and you wouldn't be able to play
those really cool games that require advanced math calculation like FX 
Fighter. Back to hex and dec(short for decimal, as hex is short for 
hexadecimal):

	So, knowing that stuff and all about decimal, you can do this:
1234567 

	Now, you can logically say, that that is very easy to break down,
and it is. Watch:

1 x 10^6, 2 x 10^5, 3 x 10^4, 4 x 10^3, 5 x 10^2, 6 x 10^1, 7 x 10^0
       -         -         -         -         -         -         -

	Hex numbers, NO matter how BIG, can be made easily into decimal 
within time. Sometimes, things just take some pencil and paper adding.

	You probably have, or might say:
"There are plenty of hex calculators and converters out there, why take time
to learn hex?"

	Here's why:
Learning hex will allow you to easily learn any number system just by 
knowing the base number. Decimal is base 10, binary is base 2, knowing that,
you should already know how to do hex. But I'll show you as if you didn't 
have a clue. Another reason to know is ANY GOOD programmer knows what he/she
is doing before doing it. Don't work on blind faith, that means, don't just
figure you'll use someone's program and get along fine. Don't go wrong and
ignore these converters and calculators, once you know hex, NO point and
deciphering big numbers when there is a converter right there. Just like a
regular calculator, no point in wasting time adding 18494 97595 while you
could pull out a calculator, and BANG, there is the answer!

----------------------------------------------------------------------------

	Now, take a look and tell me if you can figure out what this is:

345 = 3 x 16^2 + 2 x 16^1 + 5 x 16^0

	That's hex, which, is equal to what dec #? I'll guide you through
this one, if you don't get it yet, don't try that hard yet:

345 is a hex number, and, you instead of using that power of 10 thing, use a
power of 16, and that is the only difference except for one thing. I'll get
to that one thing later. Watch:

345 = 3 x (16 x 16) = 256 + 2 x (16 x 1) = 16 + 5 x (16 x 0) = 5 which is,
in decimal, then you finish it off by multiplying, and get 837  which is  in 
decimal. See? If you didn't see it yet, the hex system allows for bigger 
number with a lot less to write. See yet? We have to write more in dec to 
get to hex.  

The problem is, with hex, if you didn't spot it, that you can't numerically
write 10, because of the logic of the base 16 number system. Here is how
it was worked out:

Hex  Dec
1    1
2    2
3    3
4    4
5    5
6    6
7    7
8    8
9    9 
A    10
B    11 
C    12
D    13
E    14
F    15
-------
	Those are all the numbers to 15 in both hex and dec. Did you see
the letters A-F represent 10-15? Well, they do.

	"When do I use a hex letter?"

Answer: Maybe if we all grew up learning hex we'd know, but, for now, the 
only way is trial and error. Obviously, if you can't display a number in 
hex using just digits, then a letter is required, and, normally, you should
know where. You can always use a hex converter for really hard stuff, as 
long as you know the basics. Just rest assured you will know which one and
where to use it.

	"What else is there to hex?"

Answer: Nothing. That's it. 

	"No, wait, I don't understand yet!"
	Yup, I'll be going over it again in greater detail because I went 
through it quickly so those who understand the basis of any number system
would catch on quickly. Now for those who are less quick to catch things.

	Hex is JUST like dec but it uses A-F and is base 16. Let's take the
number 123. How do we know when something is hex? It will usually have a h
at the end of it. So, ignore the h when it comes to the math, it is ONLY
there to tell you the number is hex. Let's use 123h, which is a hex, and
convert it to decimal.

	With decimal, you would start the powers of 10 thing like this:
1 x 10^2 + 2 x 10^1 + 3

	For hex, you just change all the 10's to 16
1 x 16^2 + 2 x 16^1 + 3

	Now let's go further. Let's change the 16^'s to decimal numbers. So:
1 x (16 X 16) = 256 + 2 x (16 x 1) = 16 + 3

	Now we can times the numbers by thier 16's:
1 x 256 + 2 x 16 + 3
	Now let's add them:
256 + 32 + 3 = 291
	I got 32 from 2 x 16.

	We have now figured out that 123h in decimal is 275. Let's pick
another number. We'll try 200. REMEMBER: The h at the end of a number means
it is in hex, and has NOTHING to do with the value of the number, it just
means the number is hex.

	First, set it up as powers of 16 like so:

200 = 2 x 16^2 + 0 x 16^1 + 0

	Obviously, the 0's will not play any part in here but to put the 2 
in the 16^2 place. Now we go further by changing the 16^'s to decimal 
numbers:
2 x (16 x 16) + 0 x (16 x 1) + 0
	Now let's take another step and times the powers:
2 x (16 x 16) = 256 + 0 x (16 x 1) = 16 + 0
	Now let's times the power multiplied by the numbers in thier places:
2 x 256 = 512 + 0 x 16 = 0 + 0
	Let's finish off by adding the numbers:
512 + 0 + 0 = ???
	Can you figure it out? Obviously it's 512. Naturally, I could have
saved typing and not have included the 0's in, but to make sure you know 
that the 2 is in the 16^2 place no matter the 0's, if we had eliminated them
to begin with, it wouldn't have been the same answer. This decimal math
should show you what I am trying to say:
200 is NOT = 200 without the 0's
200 is not = 2
	
	Get it? I hope so. I am going to show you one more number, one that
uses a letter. If you see A, technically, we can't say 10, because in hex 
that would be 16, because of this logic:
10 = 1 x 16^1 + 0
1 x (16 x 1) = 16 + 0
16 + 0 = 16
10h = 16

	ONCE AGAIN: The h at the end of the number 10 is NOT part of the
number, it just tells you the number is decimal.
	
	The hex number 10 is equal to 16 because we times the 1 by 16^1 
which is 16, 1 x 16 is 16, and the 0 is added to achieve the answer 16.

	The ONLY way to represent 10-15 is A-F. By using hex more often, you
will notice that A's, B's, C's so on are required to represent numbers in 
hex that otherwise would be impossible. Let's make F1 a decimal number.

	First, we break down all the letters to thier digits, but don't make
F1 151, because that would be incorrect, just break the numbers down for 
your own visualization of it.
F = 15
	Now let's set up the powers of 16:
15 x 16^1 + 1 x 16^0
	Now we take the step to times the powers:
15 x (16 x 1) = 16 + 1 x (16 x 0) = no number
	We now have:
15 x 16 + 1
	We then times the numbers by thier powers that have already been
multiplied:
15 x 16 = 240 + 1 
	Then we add all the numbers:
240 + 1 = 241
	There is the answer. F1h is equal to 241. 
----------------------------------------------------------------------------
	
	Now, to binary. Binary is easier then decimal and hex. Binary is
a base 2 number system, and since a byte is 8 bits, usually it will be 
8 numbers long, no matter the meaning of the binary. 00000001 means 1 in the
binary form. You could lose the 0's, but since bytes are 8 bits, keep the
0's. Since they go from right to left going up one power of 2, you could
label the 8 spaces like so from left to right
[128][64][32][16][8][4][2][1]
 0    0   0   0   0  0  0  0

	Get it? If there is 10000000, you look up in your table, and see 
that that space means 128, and therefore, 10000000 is 128. Watch this:

00000010 = 2, because the 1 is in the 2's place, if you look up in your 
look-up table. You only use 0's and 1's in binary, nothing more. 0 means 
nothing, and 1 means the value of where the 1 is
00000100 = 4, you can tell because the 1 is in the 4's place in the look-up
table. 
	
	Why is the look table like that? Because:
1^2 = 2
2^2 = 4
4^2 = 8
8^2 = 16
16^2 = 32
32^2 = 64
64^2 = 128

	Get it? When it comes down to it, all numbers are powers 
multiplied and added together. Now, what if there is a 1 in the 1's place 
and a 1 in the 2's place? You add all the values of the 1's places, here
you would get 3. Watch:
00000011 = 3, because there is a 1 in the 1's place and a 1 in the 2's 
place, and 1 + 2 = 3.
10000001 = 129, because a 1 is in the 1's place and a 1 is in the 128's
place, and 128 + 1 = 129. See how you can represent numbers so easily in
binary, and you make yourself look like a genius when you say:
"I can understand and decipher this:"
10000011
10000011 = 131, because you have 1 in the 128's, 2's, and 1's place, and
128 + 2 + 1 = 131. Right? Yes. You should know it by now, Binary is straight
forward, just yes and no, 1 means yes, that value is used, and 0 means no, 
it isn't. Watch:
00001000 = 16, because the 1 says "Yes, add this value to your total." The
0's say, "Do NOT add the value's where we stand." Get it?

	To represent numbers farther then 255, which is 11111111, just add 
another byte onto the front
0000000000000000
	This two-byte group allows for bigger numbers than just one byte.
	For the new group, you just keep going on with the powers of 2.
Watch:

1^2 = 2
2^2 = 4
4^2 = 8
8^2 = 16
16^2 = 32
32^2 = 64
64^2 = 128
128^2 = 256 (Now we keep going with the second byte connected)
256^2 = 512 
512^2 = 1024
1024^2 = 2048
2048^2 = 4096
4096^2 = 8192	
8192^2 = 16384	
16384^2 = 32768

	We could add another byte, but I doubt our computer can handle 
numbers too much bigger.

	We just treat the extra byte like the first byte, figure out where 
the 1's are, find those values, and add ALL of them together, from both 
bytes and you'll get your answer, so:
1000000000000001 = 32769, because 32768 + 1 = 32769.
And so on could we keep changing 0's to 1's......
----------------------------------------------------------------------------

	That's it. I hope you got that, at least you must have gotten
binary, because it is SOOOO easy! Originally, 1 means yes or on, and 0 means
no or off. Hex numbers usually have a h at the end, but the h doesn't affect
the value, just tells you it is a hex number.

	If your a programmer or going to program, then you have learned a
BIG part of machine programming. Still, MUCH is left to know, things even 
beyond myself as of now, but, never stop reaching to go further.......


	If you would like to contact me, send e-mail via CompuServe to:
Knight Cecil, 103155,2514. Thanks!!




